package com.bdq.common.feign.interaction;

import com.bdq.common.entity.common.CommonResult;
import com.bdq.common.entity.common.PageResult;
import com.bdq.common.feign.interaction.param.InteractionDataGetParam;
import com.bdq.common.feign.interaction.param.InteractionNumInitParam;
import com.bdq.common.feign.interaction.param.UserInteractionPageParam;
import com.bdq.common.feign.interaction.param.VoteInitParam;
import com.bdq.common.feign.interaction.vo.InteractionDataGetVO;
import com.bdq.common.feign.interaction.vo.InteractionDataListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author malei
 * @date 2024-05-15 17:49
 */
@FeignClient(name = "bdq-interaction")
public interface InteractionFeign {

    /**
     * 前缀
     */
    String PREFIX = "interaction";

    /**
     * 交互数初始化
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/interaction-num/init")
    CommonResult<Boolean> interactionNumInit(@RequestBody InteractionNumInitParam param);

    /**
     * 投票初始化
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/vote/init")
    CommonResult<Boolean> voteInit(@RequestBody VoteInitParam param);

    /**
     * 获取交互
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/data/get")
    CommonResult<InteractionDataGetVO> getData(@RequestBody InteractionDataGetParam param);

    /**
     * 列表查询交互
     *
     *
     * @param userId
     * @param contentIds
     * @return
     */
    @PostMapping(PREFIX + "/data/list")
    CommonResult<List<InteractionDataListVO>> listData(@RequestParam(name = "userId") Long userId, @RequestParam(name = "contentIds") List<Long> contentIds);

    /**
     * 列表查询交互
     *
     * @param param
     * @return
     */
    @PostMapping(PREFIX + "/user/page")
    CommonResult<PageResult<Long>> pageUserInteraction(@RequestBody UserInteractionPageParam param);
}
